using System;
using System.Data;
using System.Collections.Generic;
using System.Text;

namespace demo_doan
{
    class NhaXuatBan : Interface
    {
         //attributes
        protected int manhaxuatban;
        protected string tennhaxuatban;
        //property
        public string TenNhaXuatBan
        {
            get { return tennhaxuatban; }
            set { tennhaxuatban = value; }
        }
	
        public int MaNhaXuatBan
        {
            get { return manhaxuatban; }
            set { manhaxuatban = value; }
        }
	    //buiding
        public NhaXuatBan() { }
        public NhaXuatBan(int maNXB, string tenNXB)
        {
            manhaxuatban = maNXB;
            tennhaxuatban = tenNXB;
        }
        public NhaXuatBan(NhaXuatBan nxb)
        {
            manhaxuatban = nxb.MaNhaXuatBan;
            tennhaxuatban = nxb.TenNhaXuatBan;
        }
        //method
        public override void  Insert(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            prv.ExeQuery(sql);
        }
        public override void  Update(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            prv.ExeQuery(sql);
        }
        public override void  Delete(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            prv.ExeQuery(sql);
        }
        public override DataTable Select(string sql)
        {
            Provider prv = new Provider("server=TILOM8X-PC\\SQLEXPRESS; Database=QuanLyThuVien; Integrated security=true");
            return prv.ExecuteQuery(sql);
        }
    }
}
